#include"HashTable.h"

void test1(){
    open_address::HashTable<int,int> hash;
    hash.insert(make_pair(2,2));
    hash.insert(make_pair(12,12));
    hash.insert(make_pair(4,4));
    hash.insert(make_pair(1,1));
    hash.insert(make_pair(7,7));
    hash.insert(make_pair(3,3));
    hash.insert(make_pair(5,5));
    hash.insert(make_pair(10,10));
    hash.insert(make_pair(23,23));
    hash.insert(make_pair(21,21));


    cout<<hash.insert(make_pair(10,10))<<endl;
    hash.erase(2);
    cout<<hash.erase(100)<<endl;
    cout<<hash.Find(2)<<endl;
}

void test2(){
    Hash_bucket::HashTable<int,int> hash;
    hash.Insert(make_pair(2,2));
    hash.Insert(make_pair(12,12));
    hash.Insert(make_pair(4,4));
    hash.Insert(make_pair(1,1));
    hash.Insert(make_pair(7,7));
    hash.Insert(make_pair(3,3));
    hash.Insert(make_pair(5,5));
    hash.Insert(make_pair(10,10));
    hash.Insert(make_pair(23,23));
    hash.Insert(make_pair(21,21));
    cout << "Before Expansion:" << endl;
    hash.Print();
    hash.Insert(make_pair(32,32));
    hash.Insert(make_pair(25,25));
    cout << "After Expansion:" << endl;
    hash.Print();

    cout<<hash.Insert(make_pair(10,10))<<endl;
    hash.Erase(2);
    hash.Erase(12);
    hash.Erase(32);
    cout<<hash.Erase(100)<<endl;
    cout<<hash.Find(2)<<endl;
    cout << "After Erase:" << endl;
    hash.Print();
}

int main(){
    //test1();
    //test2();

    bool ret = isHappy(19);
    return ret;
    return 0;
}